package com.dmz.wxcp.wecom.common;

import org.springframework.stereotype.Service;

import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletRequest;


@Service
public class LoginService {
//    获取token的方法
    public String getCookieValue(HttpServletRequest request,String cookiename){
        Cookie[] cookies = request.getCookies();
        if(cookies != null){
            for(Cookie cookie : cookies){
                if(cookie.getName().equals(cookiename)){
                    return cookie.getValue();
                }
            }
        }
        return null;
    }
}
